package com.net

import com.github.salomonbrys.kotson.fromJson
import com.google.gson.Gson
import com.google.gson.JsonElement
import com.helloandroid.vo.SignResponse
import org.json.JSONObject
import org.junit.Test

class TestSign {

    @Test
    fun sync_bushu(){
        val str = """
            {"err":0,"data":{"money":58,"signed_count":1,"sign_time_stamp":"2021-02-22T19:35:41.000Z"}}
        """.trimIndent()

//        val jsonObj = (Gson().fromJson(str) as JsonElement).asJsonObject
//        val err = jsonObj.get("err").asInt
//        if (err == 0){
//            val signResponse = Gson().fromJson<SignResponse>(jsonObj.get("data").toString())
//            log(signResponse.toString())
//            log("xxx:${signResponse.signTimeMs}")
//        }else{
//            log("err:$err")
//        }

//        val jsonObject = JSONObject(str)
//        val pair = jsonObject.getInfo()
//        println(pair.first)
//        println(pair.second)
    }
}

